#ifndef __CX_LOG_H__
#define __CX_LOG_H__

#include "cx_typedef.h"
#include "cx_file.h"

#ifdef __cplusplus
extern "C" {
#endif

	QVOID cx_log_to_file(CXFILE file, QCHAR* format, ...);
#ifndef CX_PLATFORM_MTK_VRE
#ifdef WIN32
	#define CX_INFO_LOG(file, format,...)\
		cx_log_to_file(file, "[%s %d] Info:"format, __FILE__, __LINE__, __VA_ARGS__)

	#define CX_WARN_LOG(file, format,...)\
		cx_log_to_file(file, "[%s %d] Warning:"format, __FILE__, __LINE__, __VA_ARGS__)

	#define CX_ERROR_LOG(file, format,...)\
		cx_log_to_file(file, "[%s %d] Error:"format, __FILE__, __LINE__, __VA_ARGS__)

	#define CX_FATAL_LOG(file, format,...)\
		cx_log_to_file(file, "[%s %d] Fatal:"format, __FILE__, __LINE__, __VA_ARGS__)
#endif
#else
	#define CX_INFO_LOG
// QINT CX_INFO_LOG(char *file,const char *format,...)//(char *p, const char *s, ...)
// {
// 	va_list ap;
// 	va_start(ap, format);
// 
// 	vsprintf(file, format, ap);
// 	cx_log_to_file(file, "[%s %d] Error:"format, __FILE__, __LINE__, ap)
// 	//return 0;
// }
	#define CX_WARN_LOG
	#define CX_ERROR_LOG
	#define CX_FATAL_LOG
#endif



#ifdef __cplusplus
}
#endif //extern "C"

#endif  //__CX_LOG_H__
